Skip to content

feat(mcp): expose outcome calibration via gittensory_get_outcome_calibration - #1174

Merged
JSONbored merged 3 commits into
JSONbored:mainfrom
jason020818:feat/mcp-outcome-calibration-v2
Jun 24, 2026
Merged

feat(mcp): expose outcome calibration via gittensory_get_outcome_calibration#1174
JSONbored merged 3 commits into
JSONbored:mainfrom
jason020818:feat/mcp-outcome-calibration-v2

Conversation

@jason020818

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • vitest mcp-output-schemas outcome_calibration test

Supersedes #1171 — addresses AI reviewer null-safety feedback.

jason020818 and others added 2 commits June 24, 2026 05:09
…bration

Wire the slop-band and recommendation outcome calibration service into MCP
so maintainers can inspect predictive accuracy without a separate HTTP call.
Includes structured output schema validation tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use optional chaining on the slop calibration slice so the MCP tool
returns a safe fallback summary instead of throwing on sparse reports.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jason020818
jason020818 requested a review from JSONbored as a code owner June 24, 2026 05:20
@dosubot dosubot Bot added the size:M label Jun 24, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.86%. Comparing base (f085f78) to head (7cdec26).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1174   +/-   ##
=======================================
  Coverage   94.85%   94.86%           
=======================================
  Files         156      156           
  Lines       18909    18920   +11     
  Branches     6848     6850    +2     
=======================================
+ Hits        17937    17948   +11     
  Misses        387      387           
  Partials      585      585           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghost

ghost commented Jun 24, 2026

Copy link
Copy Markdown

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review — safe to merge

3 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green

✅ Approved — safe to merge

Review summary
The change adds a new MCP tool `gittensory_get_outcome_calibration` that returns slop‑band calibration data for a repository. It introduces input and output Zod schemas, registers the tool, and implements a private handler that builds the report and crafts a human‑readable summary. The implementation compiles and integrates with existing tooling, and tests are added to verify schema compliance and basic functionality.

Nits (5)

  • src/mcp/server.ts: The ternary `input.windowDays !== undefined ? input.windowDays : undefined` is redundant; passing `input.windowDays` directly would be clearer.
  • src/mcp/server.ts: The summary construction uses nested ternary operators, which reduces readability; consider extracting into a helper function.
  • src/mcp/server.ts: The output schema types `slop` and `recommendations` are `z.unknown()`. More specific schemas would improve validation and documentation.
  • test/unit/mcp-output-schemas.test.ts: The test expects `data.windowDays` to be present in the returned report; ensure `buildRepoOutcomeCalibration` includes this field or augment the handler to add it.
  • test/unit/mcp-output-schemas.test.ts: The test checks that `data.signals` is an array; verify that the calibration report always provides a `signals` array to satisfy the schema.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #1171
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels; size label size:M.
Validation evidence ✅ 25/25 PR body includes validation/test evidence.
Open PR queue ✅ 10/10 0 open PR(s), 0 likely reviewable.
Contributor context ✅ Confirmed Gittensor contributor jaso0n0818; Gittensor profile; 1361 PR(s), 5 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jaso0n0818
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Rust, Shell, C++, Dart, Ruby, Scala, TypeScript
  • Official Gittensor activity: 1361 PR(s), 5 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review details

Generated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative.

The change adds a new MCP tool `gittensory_get_outcome_calibration` that returns slop‑band calibration data for a repository. It introduces input and output Zod schemas, registers the tool, and implements a private handler that builds the report and crafts a human‑readable summary. The implementation compiles and integrates with existing tooling, and tests are added to verify schema compliance and basic functionality.

Nits (5)

  • src/mcp/server.ts: The ternary `input.windowDays !== undefined ? input.windowDays : undefined` is redundant; passing `input.windowDays` directly would be clearer.
  • src/mcp/server.ts: The summary construction uses nested ternary operators, which reduces readability; consider extracting into a helper function.
  • src/mcp/server.ts: The output schema types `slop` and `recommendations` are `z.unknown()`. More specific schemas would improve validation and documentation.
  • test/unit/mcp-output-schemas.test.ts: The test expects `data.windowDays` to be present in the returned report; ensure `buildRepoOutcomeCalibration` includes this field or augment the handler to add it.
  • test/unit/mcp-output-schemas.test.ts: The test checks that `data.signals` is an array; verify that the calibration report always provides a `signals` array to satisfy the schema.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@ghost ghost added gittensory:reviewed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 24, 2026
@JSONbored
JSONbored merged commit d728e32 into JSONbored:main Jun 24, 2026
14 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 24, 2026
12 tasks
JSONbored added a commit that referenced this pull request Jun 26, 2026
…intainer_noise (#1414)

The deterministic maintainer-noise report (`buildMaintainerNoiseReport`,
src/signals/reward-risk.ts) ranks which queue-noise sources a maintainer should
clear first — open PRs without linked-issue context, broad/churn-style diffs,
duplicate clusters, and contributor-intake pressure — with a score, level, and
recommended maintainer actions. It already powers the `@gittensory noise-report`
PR command but had no MCP surface, so agents/CLI couldn't pull it.

Add `gittensory_get_maintainer_noise` (maintainer-authenticated, advisory only),
mirroring the outcome-calibration serving (#1174): a thin load-or-compute service
(`src/services/maintainer-noise.ts`) that loads the repo's cached signals and runs
the existing builder, plus the MCP tool registration + output schema + method.

No new REST route, no migration, no auth-policy change — purely additive to the
MCP surface. Output flows through the existing `redactSensitiveForMcp` wrapper.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com>
oktofeesh1 added a commit to oktofeesh1/loopover-oktofeesh1 that referenced this pull request Jun 26, 2026
…r_lane

The deterministic maintainer-lane report (`buildMaintainerLaneReport`,
src/signals/engine.ts) synthesizes a repo's lane recommendation alongside the
configured maintainer cut, queue health, config quality, and contributor-intake
health — the maintainer's own-lane triage view. It already powers the
repo-intelligence response but had no MCP surface, so agents/CLI couldn't pull it
(it is also absent from gittensory_get_repo_context).

Add `gittensory_get_maintainer_lane` (maintainer-authenticated via the existing
requireRepoAccess, advisory only), mirroring the merged maintainer-noise /
outcome-calibration serving (JSONbored#1414 / JSONbored#1174): a thin load-or-compute service
(src/services/maintainer-lane.ts) that loads the repo's cached signals + collision
report and runs the existing builder, plus the MCP tool registration + output
schema + method. Output flows through the existing redactSensitiveForMcp wrapper.

No new REST route, no migration, no auth-policy change — purely additive to the
MCP surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
oktofeesh1 added a commit to oktofeesh1/loopover-oktofeesh1 that referenced this pull request Jun 26, 2026
The deterministic label audit (`buildLabelAudit`, src/signals/engine.ts) reports
whether a repo's configured (.gittensory.yml / dashboard) label set matches the
live GitHub labels and is trustworthy for label-multiplier scoring — surfacing
missing configured labels, suspicious status/source-style labels, and the overall
trusted-label-pipeline readiness. It already powers the repo-intelligence response
but had no MCP surface, so agents/CLI couldn't pull it (it is also absent from
gittensory_get_repo_context, which exposes a different subset).

Add `gittensory_get_label_audit` (maintainer-authenticated via the existing
requireRepoAccess, advisory only), mirroring the merged maintainer-noise (JSONbored#1414)
and outcome-calibration (JSONbored#1174) serving: a thin load-or-compute service
(src/services/label-audit.ts) that loads the repo's labels + cached signals and
runs the existing builder, plus the MCP tool registration + output schema +
method. Output flows through the existing redactSensitiveForMcp wrapper.

No new REST route, no migration, no auth-policy change — purely additive to the
MCP surface.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
JSONbored added a commit that referenced this pull request Jun 27, 2026
…r_lane (#1456)

The deterministic maintainer-lane report (`buildMaintainerLaneReport`,
src/signals/engine.ts) synthesizes a repo's lane recommendation alongside the
configured maintainer cut, queue health, config quality, and contributor-intake
health — the maintainer's own-lane triage view. It already powers the
repo-intelligence response but had no MCP surface, so agents/CLI couldn't pull it
(it is also absent from gittensory_get_repo_context).

Add `gittensory_get_maintainer_lane` (maintainer-authenticated via the existing
requireRepoAccess, advisory only), mirroring the merged maintainer-noise /
outcome-calibration serving (#1414 / #1174): a thin load-or-compute service
(src/services/maintainer-lane.ts) that loads the repo's cached signals + collision
report and runs the existing builder, plus the MCP tool registration + output
schema + method. Output flows through the existing redactSensitiveForMcp wrapper.

No new REST route, no migration, no auth-policy change — purely additive to the
MCP surface.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com>
JSONbored added a commit that referenced this pull request Jun 27, 2026
…dit (#1461)

The deterministic label audit (`buildLabelAudit`, src/signals/engine.ts) reports
whether a repo's configured (.gittensory.yml / dashboard) label set matches the
live GitHub labels and is trustworthy for label-multiplier scoring — surfacing
missing configured labels, suspicious status/source-style labels, and the overall
trusted-label-pipeline readiness. It already powers the repo-intelligence response
but had no MCP surface, so agents/CLI couldn't pull it (it is also absent from
gittensory_get_repo_context, which exposes a different subset).

Add `gittensory_get_label_audit` (maintainer-authenticated via the existing
requireRepoAccess, advisory only), mirroring the merged maintainer-noise (#1414)
and outcome-calibration (#1174) serving: a thin load-or-compute service
(src/services/label-audit.ts) that loads the repo's labels + cached signals and
runs the existing builder, plus the MCP tool registration + output schema +
method. Output flows through the existing redactSensitiveForMcp wrapper.

No new REST route, no migration, no auth-policy change — purely additive to the
MCP surface.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants